﻿using System;

namespace _10_Facade
{
    /// <summary>
    /// 外观模式
    /// </summary>
    class Program
    {
        //需要给用户发送短信和系统通知，短信可以接口可能会变，或者批量发送，
        static void Main(string[] args)
        {
            Facade f = new Facade();
            f.SendMessage("Icon mam");
        }
    }
    class Facade
    {
        private SMS sms;
        private Notice notice;
        public Facade()
        {
            sms = new SMS();
            notice = new Notice();
        }
        public void SendMessage(string name)
        {
            sms.SendSMS(name);
            notice.SendNotice(name);
        }
    }
    //发送短信
    class SMS
    {
        public void SendSMS(string name)
        {
            Console.WriteLine("Send a Sms to {0}",name);
        }
    }
    //发送通知
    class Notice
    {
        public void SendNotice(string name)
        {
            Console.WriteLine("Send a notice to {0}",name);
        }
    }
}
